package com.wd.mylibrary_square.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.wd.mylibrary_base.bean.LiveBean
import com.wd.mylibrary_base.utils.HttpUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

/**
 * 作者: 邢凌志
 * 时间: 2024/9/13
 * 描述:
 */

class SquareViewModel : ViewModel(){
    var liveData= MutableLiveData<LiveBean>()

    fun getLiveData(userId:Int,liveType:Int,page:Int,size:Int){
        viewModelScope.launch(Dispatchers.IO) {
            liveData.postValue(HttpUtils.httpUtils.apiService.getLive(userId,liveType,page,size))
        }
    }
}